package org.thanos.demo.handler;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.thanos.demo.vo.req.LogOutMsg;
import org.thanos.demo.vo.resp.CommonResp;
import org.springframework.stereotype.Component;


@Slf4j
@Component
@ChannelHandler.Sharable
public class LogOutMsgHandler extends BaseHandler<LogOutMsg> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, LogOutMsg msg) throws Exception {
        log.info(msg.toString());
        CommonResp resp = CommonResp.success(msg, getSerialNumber(ctx.channel()));
        write(ctx,resp);
    }
}
